﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using KT.Framework.Web;

namespace KT.WebApp
{
    /// <summary>
    /// firstpage 的摘要说明
    /// </summary>
    public class firstpage : VTemplatePage
    {
        /// <summary>
        /// 初始化页面模板
        /// </summary>
        public override void InitPageTemplate()
        {
            this.LoadCurrentPageTemplate();
        }

        /// <summary>
        /// 站点的配置
        /// </summary>
        public override WebSiteConfiguration Configuration
        {
            get 
            {
                return WebSiteConfiguration.From<WebSiteConfiguration>("website.config");
            }
        }


        /// <summary>
        /// 获取时间值
        /// </summary>
        /// <returns></returns>
        [AjaxHandlerMethod("timer")]
        public long GetTimer()
        {
            return DateTime.Now.Ticks;
        }

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <returns></returns>
        [AjaxHandlerMethod("data")]
        public object GetData()
        {
            string r = Request.Form["r"];
            return new
            {
                id = DateTime.Now.Ticks,
                rnd = r
            };
        }
    }
}